<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2008 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/conformanceFunction.xsl"?>
<testcase
  xmlns="http://xbrl.org/2008/conformance"
  xmlns:reg="http://xbrl.org/2008/registry"
  xmlns:fcn="http://xbrl.org/2008/function"
  xmlns:cfcn="http://xbrl.org/2008/conformance/function"
  xmlns:xbrli="http://www.xbrl.org/2003/instance"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xfi="http://www.xbrl.org/2008/function/instance"
  xmlns:xfie="http://www.xbrl.org/2008/function/instance/error"
  xmlns:xqt-err="http://www.w3.org/2005/xqt-errors"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:t="http://xbrl.org/formula/conformance/example" 
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  http://xbrl.org/2008/conformance ../schemas/conformance.xsd
  http://xbrl.org/2008/conformance/function ../schemas/conformanceFunction.xsd
  ">
  <owners>
    <reg:owner id="herm">
      <reg:name>Herm Fischer</reg:name>
      <reg:affiliation>UBMatrix / Mark V Systems</reg:affiliation>
      <reg:email>fischer@markv.com</reg:email>
     <reg:assumedOwnership moment="2008-09-02T00:00:00" />
    </reg:owner>
  </owners>

  <number>90307</number>

  <name>xfi:fact-has-typed-dimension</name>

  <documentation>
  </documentation>

  <reference
    xlink:type="simple"
    xlink:href="90308 xfi.fact-has-dimension function.xml">
    function definition  
  </reference>

  <variation id="V-01">
    <name>Test height dimension for Mount Kilimanjaro for Mount Kilimanjaro</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V01" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V01">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Kilimanjaro'], 
          QName('http://xbrl.org/formula/conformance/example','t:HeightDimension')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:boolean and
         count( $result ) eq 1 and
         $result eq true()
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-02">
   <name>Height dimension for pre-eruption volcano (whose hypercube lacks the location dimension because the volcano is not erupted yet, but it has alternate link roles allowing height to be added later after erupting)</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V02" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V02">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:Peak[./text() eq 'Pre-eruption volcano'], 
          QName('http://xbrl.org/formula/conformance/example','t:HeightDimension')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:boolean and
         count( $result ) eq 1 and
         $result eq false()
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-03">
   <name>Height dimension for SpacePhenomenon concept Wormhole (whose hypercube for space warping can never have the height dimension)</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V03" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V03">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:SpacePhenomenon[1], 
          QName('http://xbrl.org/formula/conformance/example','t:HeightDimension')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:boolean and
         count( $result ) eq 1 and
         $result eq false()
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-04">
    <name>Error of concept argument which is not a dimension</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V04" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V04">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Everest'], 
          QName('http://xbrl.org/formula/conformance/example','t:Mars')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xfie:invalidTypedDimensionQName</error>
    </outputs>
  </variation>

  <variation id="V-04a">
    <name>Error of non-XBRL element argument as dimension argument</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V04a" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V04a">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Everest'], 
          QName('http://xbrl.org/formula/conformance/example','t:nonXbrlElement')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xfie:invalidTypedDimensionQName</error>
    </outputs>
  </variation>

  <variation id="V-05">
    <name>Error of non-XBRL element argument as dimension argument</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V05" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V05">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Kilimanjaro'], 
          QName('http://xbrl.org/formula/conformance/example','t:nonXbrlElement')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xfie:invalidTypedDimensionQName</error>
    </outputs>
  </variation>

  <variation id="V-06">
    <name>Raises an error for an attribute declaration argument</name>
    <documentation>
      <xhtml:p>
        Tests that error is detected when the concept name argument declares an attribute.
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V06" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V06">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Kilimanjaro'], 
          QName('http://xbrl.org/formula/conformance/example','t:anAttribute')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xfie:invalidTypedDimensionQName</error>
    </outputs>
  </variation>

  <variation id="V-07">
    <name>Raises an error for an xbrli namespace&apos;ed argument</name>
    <documentation>
      <xhtml:p>
        Tests that error is detected when the concept qname is xbrli:item
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="fact-explicit-dimension-value.xsd"/>
      <linkbase xlink:type="simple" xlink:href="fact-explicit-dimension-value-definition.xml"/>
      <instance readMeFirst="true" id="V07" xlink:type="simple" xlink:href="fact-explicit-dimension-value-instance1.xml"/>
      <cfcn:call file="V07">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:Peak[./text() eq 'Mount Kilimanjaro'], 
          QName('http://xbrl.org/formula/conformance/example','xbrli:item')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xfie:invalidTypedDimensionQName</error>
    </outputs>
  </variation>

  <variation id="V-08">
   <name>Dimension can be located in either segment or scenario, for this variation appears in the segment, to test that function is looking in either location for value.</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="bi-locational-dim-concepts.xsd"/>
      <linkbase xlink:type="simple" xlink:href="bi-locational-dim-definition.xml"/>
      <instance readMeFirst="true" id="V08" xlink:type="simple" xlink:href="bi-locational-seg-typed-instance.xml"/>
      <cfcn:call file="V08">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:PriItem1[1], 
          QName('http://xbrl.org/formula/conformance/example','t:TypedDim1')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:boolean and
         count( $result ) eq 1 and
         $result eq true()
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-09">
   <name>Dimension can be located in either segment or scenario but for this variation appears in the scenario instead of segment, to test that function is looking in either location for value.</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
      
    <inputs>
      <schema xlink:type="simple" xlink:href="bi-locational-dim-concepts.xsd"/>
      <linkbase xlink:type="simple" xlink:href="bi-locational-dim-definition.xml"/>
      <instance readMeFirst="true" id="V09" xlink:type="simple" xlink:href="bi-locational-scen-typed-instance.xml"/>
      <cfcn:call file="V09">
        xfi:fact-has-typed-dimension(
          /xbrli:xbrl/t:PriItem1[1], 
          QName('http://xbrl.org/formula/conformance/example','t:TypedDim1')
          )
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         $result instance of xs:boolean and
         count( $result ) eq 1 and
         $result eq true()
      </cfcn:test>
    </outputs>
  </variation>

  <revisions>
    <reg:revision on="2008-09-02T00:00:00" by="herm">
      <xhtml:p>
        Created the test case.
      </xhtml:p>
    </reg:revision>
  </revisions>

</testcase>






